# -*- coding: utf-8 -*-
"""
 ----------------------------------------
|File Name:     getFormData
|Author:        WYT
|date:          2020/8/3
 ----------------------------------------
|  Change Activity:
|                   2020/8/3:
-----------------------------------------
"""
from util.DataQuery.FormDataQuery import FormDataQuery


def getFormData(name):
    class_name = name

    query_obj = FormDataQuery(class_name=class_name)

    result = query_obj.func_data()
    if not result:
        return True
    for i in result:
        if "id" in i:
            i.pop("id")
    if len(result) == 1:
        return result[0]
    return result


